package se.stabby.undersokning.webapp;

import com.google.common.base.Preconditions;
import se.stabby.undersok.model.Svar;

import javax.ws.rs.core.Variant;

/**
 * User: per.segersten
 * Date: 2014-07-01
 */
public class UndersokningResult {

    private String analys;
    private String undersokningsId;
    private String id;

    public String getAnalys() {
        return analys;
    }

    public void setAnalys(String analys) {
        this.analys = analys;
    }

    public String getUndersokningsId() {
        return undersokningsId;
    }

    public void setUndersokningsId(String undersokningsId) {
        this.undersokningsId = undersokningsId;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public static Builder create() {
        return new Builder();
    }

    public static class Builder {

        private UndersokningResult result = new UndersokningResult();

        public UndersokningResult build() {
            Preconditions.checkNotNull(result.analys);
            Preconditions.checkNotNull(result.id);
            Preconditions.checkNotNull(result.undersokningsId);

            return new UndersokningResult();
        }

        public Builder resultat(String analys) {
            result.analys = analys;
            return this;
        }

        public Builder undersokningsId(long id) {
            result.undersokningsId = Long.toString(id);
            return this;
        }

        public Builder id(long id) {
            result.id = Long.toString(id);
            return this;
        }
    }
}
